{% extends 'cms/cms-base.html' %}
{% block title %}新发布{% endblock %}
{% block main %}
    <blockquote class="layui-elem-quote"><h2>新发布</h2></blockquote>
    <div class="layui-row">
        <form class="layui-form layui-row layui-col-space10 layui-form-pane" id="postForm">
            <div class="layui-col-md8 layui-col-xs12">
                <div class="layui-form-item">
                    <label class="layui-form-label">标题</label>
                    <div class="layui-input-block">
                        <input type="text" name="title" required="" lay-verify="title"
                               placeholder="请输入标题" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">内容</label>
                    <div class="layui-input-block">
                                        <textarea placeholder="请输入内容" class="layui-textarea" name="content" id="content"
                                                  lay-verify="content"></textarea>
                    </div>
                </div>
            </div>
            <div class="layui-col-md4 layui-col-xs12">
                <blockquote class="layui-elem-quote title"><i class="seraph icon-caidan"></i> 类目
                </blockquote>
                <div class="layui-form-item">
                    <input type="radio" name="type_id" value="0" title="无类目" checked>
                    {% for type in types %}
                        <input type="radio" name="type_id" value="{{ type.id }}" title="{{ type.name }}">
                    {% endfor %}
                </div>
                <blockquote class="layui-elem-quote title"><i class="seraph icon-caidan"></i> 话题
                </blockquote>
                <div class="layui-form-item">
                    <select name="topic_id" lay-search>
                        <option value="0">无话题</option>
                        {% for topic in topics %}
                            <option value="{{ topic.tid }}">{{ topic.title }}</option>
                        {% endfor %}
                    </select>
                </div>
                <blockquote class="layui-elem-quote title magt10">发布
                </blockquote>
                <div class="layui-form-item">
                    <a class="layui-btn layui-btn-fluid" lay-filter="addPost"
                       lay-submit>发布</a>
                </div>
            </div>
        </form>
    </div>
{% endblock %}
{% block footer %}
    <script src="{% static 'js/cms/publish.min.js' %}"></script>
{% endblock %}
